package com.hmall.mapper;

import com.hmall.model.ShopCategory;
import com.hmall.util.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ShopCategoryMapper extends MyMapper<ShopCategory> {
    List<ShopCategory> selectRepeatData(@Param("categoryName") String categoryName,@Param("shopId") Integer shopId,@Param("parentId") Integer parentId);

    ShopCategory selectCategory(@Param("categoryId") Integer categoryId);

    List<ShopCategory> selectExceptSelfRepeatData(@Param("categoryName") String categoryName,@Param("shopId") Integer shopId,@Param("categoryId") Integer categoryId,@Param("parentId") Integer parentId);

    List<ShopCategory> selectByShopId(@Param("shop_id") Integer shop_id);

    List<ShopCategory> selectByParentId(@Param("parentId") Integer parentId);

    Integer checkHaveChild(@Param("categoryId") Integer categoryId);

    List<ShopCategory> selectByShopId2(@Param("shop_id") Integer shop_id);

    List<ShopCategory> selectRepeatDataWithDisable(@Param("categoryName") String categoryName,@Param("shopId") Integer shopId,@Param("parentId") Integer parentId);
}